import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.util.*;

public class WX {
    public static void main(String[] args) {
        List<Modu> list = new ArrayList<>();
        list.add(new Modu(201215121,"李勇","男",20,"CS"));
        list.add(new Modu(201215121,"李勇2","男",20,"CS"));
        list.add(new Modu(201215122,"dw","男",20,"CS"));



        Map<Long,List<Modu>> map = new HashMap<>();
        for (Modu modu : list) {
            if (!map.containsKey(modu.getSno())){ //检测key是否存在
                List<Modu> l = new ArrayList<>();
                l.add(modu);
                map.put(modu.getSno(),l);
            }else {
                map.get(modu.getSno()).add(modu);
            }
        }
        List<List<Modu>> re = new ArrayList<>(map.values()); //将map的所有value添加到一个list中
        int t = 0;

    }

}
class Modu{
    private long Sno;
    private String Sname;
    private String sex;
    private int Sage;
    private String Sdept;

    public long getSno() {
        return Sno;
    }

    public String getSname() {
        return Sname;
    }

    public String getSex() {
        return sex;
    }

    public int getSage() {
        return Sage;
    }

    public String getSdept() {
        return Sdept;
    }

    public Modu(long sno, String sname, String sex, int sage, String sdept) {
        Sno = sno;
        Sname = sname;
        this.sex = sex;
        Sage = sage;
        Sdept = sdept;
    }
}